<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        .active {
            color: red;
        }
    </style>
</head>
<body>
<div id="app">
    <ul>
        <li v-for="(item,index) in name"  v-bind:class="{active:index===currentIndex}"  v-on:click="fun(index)">{{item}}</li>
    </ul>
</div>
<!-- vue js库-->
<script src="../vue.js"></script>

<script>

    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!',
            name: [1111,2222,3333,4444],
            currentIndex:0,
        },
        methods: {
          fun(index){
              this.currentIndex=index;
          }
        }
    })
</script>
</body>
</html>